<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- <button @click="decrement()">-</button> -->
    <button @click="num -=1">-</button>
     <span>{{num}}</span>
    <!-- 需要拿到事件对象的，必须用 $event -->
     <button @click="increment($event,2)">+</button>

  </div>

  <script>
    var vm = new Vue({
      el: "#app",
      data: {
        num: 0
      },
      methods: {
        decrement:function() {
          this.num -= 1;
        },
        increment(e,n){
          this.num +=n;
          console.log(e)
        }
      }
    })

  </script>
</body>

</html>